﻿@using STX.Domain
@using STX.Web.Framework.Security
@model STX.Web.Framework.Query.PagedList<STX.Domain.BizActivity>
@{
    ViewBag.Title = "Query";
    Layout = null;
    STX.Domain.TabAdministrator CurUser = ViewBag.CurUser;
}
<div class="pageContent" ratio="*" style="width: 100%">
    <div class="grid" style="width:1700px;">
        <table class="table" width="100%" layoutH="138" cellpadding="0" cellspacing="0">
            <thead>
                <tr>
                    <th width="22">
                        <input type="checkbox" group="ids" class="checkboxCtrl" />
                    </th>
                    <th width="100">
                        所属项目
                    </th>
                    <th width="200">
                        活动名称
                    </th>
                    <th width="150">
                        活动时间
                    </th>
                    <th  width="80">
                        合同报价
                    </th>
                    <th  width="80">
                        增减情况
                    </th>
                    <th  width="80">
                        是否开票
                    </th>
                    <th  width="80">
                        通知开票
                    </th>
                    <th  width="80">
                        通知日期
                    </th>
                    <th  width="80">
                        开票日期
                    </th>
                    <th  width="100">
                        发票号码
                    </th>  
                    <th  width="80">
                        是否回款
                    </th>
                    <th  width="100">
                        回款日期
                    </th>
                    <th  width="80">
                        回款金额
                    </th>
                    <th  width="80">
                        未收款
                    </th>
                    <th  width="80">
                        已开票未收款
                    </th>
                    <th  width="80">
                        未开票
                    </th>
                    <th  width="80">
                        已收款
                    </th>
                    <th  width="80">
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.Data)
                {
                    <tr>
                        <td style="text-align: center">
                            <input name="ids" value="@item.Id" type="checkbox" />
                        </td>
                        <td>@item.BizProject.Name
                        </td>
                        <td>@item.Name
                        </td>
                        <td>@item.StartTime.ToString("yyyy-M-d") - @item.EndTime.ToString("yyyy-M-d")
                        </td>
                        <td>
                            @item.TotalQuotation
                        </td>
                        <td>
                            @item.IncreaseOrDecrease
                        </td>
                        <td class="lightyellow">
                            @(item.IsMadeInvoice?"是":"")
                        </td>
                        <td  class="lightyellow">
                            @item.ApplyInvoiceMan
                        </td>
                        <td  class="lightyellow">
                            @if (item.IsMadeInvoice)
                            {
                                @item.ApplyInvoiceDate.ToString("yyyy-M-d")
                            }
                        </td>
                        <td  class="lightyellow">
                            @if (item.IsMadeInvoice)
                            {
                                @item.MakeInvoiceDate.ToString("yyyy-M-d")
                            }
                        </td>
                        <td  class="lightyellow">
                            @item.InvoiceNo
                        </td>
                        <td  class="lightblue">
                            @(item.IsReturned?"是":"")
                        </td>
                        <td  class="lightblue">
                            @if (item.IsReturned)
                            {
                                @item.ReturnedDate.ToString("yyyy-M-d")
                            }
                        </td>
                        <td  class="lightblue">
                            @if (item.ReturnedAmount > 0)
                            {
                                @item.ReturnedAmount
                            }
                        </td>
                        <td  class="lightgreen">
                            @if (item.WSK > 0)
                            {
                                @item.WSK
                            }
                        </td>
                        <td  class="lightgreen">
                            @if (item.YKPWSK > 0)
                            {
                                @item.YKPWSK
                            }
                        </td>
                        <td  class="lightgreen">
                            @if (item.WKP > 0)
                            {
                                @item.WKP
                            }
                        </td>
                        <td  class="lightgreen">
                            @if (item.YSK > 0)
                            {
                                @item.YSK
                            }
                        </td>
                        <td>
                            @{
                            //执行制作报价阶段
                            if (CurUser.Position== PositionEnum.CFO || CurUser.Position== PositionEnum.FinancialManager || CurUser.Position== PositionEnum.SystemPower)
                            {
                                <a href="@Url.Action("edit", new { id = item.Id })" target="dialog" width="600"  height="500" backtype="html" refreshonclose="true">录入信息</a>
                            }

                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
@Html.Partial("~/Administrator/Views/Shared/Pager.cshtml", new STX.Admin.Models.PagerModel { Page = Model.Page, Total = Model.Total, PageSize = Model.PageSize })
